EfImageFormatter
class EfImageFormatter extends EfFieldFormatter
Provides formatting methods for image
field types.
Methods
Returns an array of all field items as EfFieldFormatter objects.
Checks if the given or current field delta exists.
Shortcut for the possible not so easy to understand isDeltaValid() method.
Implementing IteratorAggregate interface.
Set the image style which is used when printing this image.
Returns the URL for this image.
Returns the relative path including query (itok).
Returns an tag for this image.
Returns the alt attribute for this image.
Returns the title attribute for this image.
Returns the width for this image.
Returns the height for this image.
No description
Details
in EfFieldFormatter at line 23
__construct(EntityMetadataWrapper $property, bool $isMultivalue)
Constructor.
in EfFieldFormatter at line 43
array|string
value()
Returns the current field item as a raw array.
in EfFieldFormatter at line 52
array
values()
Returns all raw field items in an array.
in EfFieldFormatter at line 61
EfFieldFormatter[]
all()
Returns an array of all field items as EfFieldFormatter objects.
in EfFieldFormatter at line 74
array
setDelta($delta)
Set the current field delta.
in EfFieldFormatter at line 91
bool
isDeltaValid(null $delta = NULL)
Checks if the given or current field delta exists.
in EfFieldFormatter at line 102
bool
notEmpty()
Shortcut for the possible not so easy to understand isDeltaValid() method.
in EfFieldFormatter at line 113
bool
isAccessible()
Check if current user is allowed to view this field.
Can be needed if a module like field_permissions is in use.
in EfFieldFormatter at line 124
EfFieldFormatterIterator
getIterator()
Implementing IteratorAggregate interface.
If we wrap a list, we return an iterator over the data list.
in EfFieldFormatter at line 133
int
count()
Implementing Countable interface.
at line 317
$this
setImageStyle($imageStyle)
Set the image style which is used when printing this image.
at line 327
string
src()
Returns the URL for this image.
at line 345
mixed|string
relativePath()
Returns the relative path including query (itok).
at line 365
string
img()
Returns an tag for this image.
at line 390
string
alt()
Returns the alt attribute for this image.
at line 404
string
title()
Returns the title attribute for this image.
at line 418
string
width()
Returns the width for this image.
at line 444
string
height()
Returns the height for this image.